<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template name="str2num">
 <xsl:param name="value"/>
 <xsl:param name="NaNvalue" select='0' />
 <xsl:if test="string(number($value)) = 'NaN'"><xsl:value-of select='$NaNvalue' /></xsl:if>
 <xsl:if test="string(number($value)) != 'NaN'"><xsl:value-of select='number($value)' /></xsl:if>
</xsl:template>
</xsl:stylesheet>